﻿namespace DotNetUtility.Parser
{
    public static class ExpressionPattern
    {
        /// <summary>
        /// Is alpha numeric. This could be written as [A-Za-z0-9]. 
        /// </summary>
        public static readonly string AlphaNumeric = @"\w";
        /// <summary>
        /// Is alpha numeric and also is the length of the text is same as length specified in {0}
        /// </summary>
        public static readonly string AlphaNumericWithLength = @"\w{0}";

        /// <summary>
        /// 
        /// </summary>
        public static readonly string AlphaNumericWithNoOfDigitsAtEnd = @"^\w\d{0}$";

        /// <summary>
        /// Is alpha numeric  and the no of digits at front of the given text. No of digits is user defined.
        /// \d - to check digit
        /// {0} - will set the no if times the digit will appear
        /// [a-zA-Z] - character match
        /// + - One or more
        /// </summary>
        public static readonly string AlphaNumericWithNoOfDigitsAtFront = @"^\d{0}[a-zA-Z]+$";
        /// <summary>
        /// ^   - start of the text
        /// \d  - digit to match
        /// {0} - no of digit to match
        /// $   - end of the text
        /// </summary>
        public static readonly string NumericWithNoOfDigits = @"^\d{0}$";

        /// <summary>
        /// ^   - start of the text
        /// \d  - digit to match
        /// {0} - no of digit to match
        /// $   - end of the text
        /// </summary>
        public static readonly string NumericInRange = @"^\d{0}$";

        /// <summary>
        /// + - One or more
        /// </summary>
        public static readonly string Alphabetic = @"^[a-zA-Z]+$";
        /// <summary>
        /// 
        /// </summary>
        public static readonly string AlphabeticInRange = @"^[a-zA-Z]{0}$";

        /// <summary>
        /// ^ - start of text
        /// $ - end of the text
        /// + - One or More
        /// </summary>
        public static readonly string AlphabeticInUppercase = @"^[A-Z]+$";

        /// <summary>
        /// ^ - start of text
        /// $ - end of the text
        /// + - One or More
        /// </summary>
        public static readonly string AlphabeticInLowercase = @"^[a-z]+$";

        /// <summary>
        /// ^ - start of text
        /// $ - end of the text
        /// + - One or More
        /// </summary>
        public static readonly string EmailAddress = @"^\w+\@\w+\.[a-zA-Z]{2,3}$";

        /// <summary>
        /// ^ - start of text
        /// $ - end of the text
        /// + - One or More
        /// </summary>
        public static readonly string Article = @"^(a|an|the)$";
        /// <summary>
        /// ^ - start of text
        /// $ - end of the text
        /// + - One or More
        /// </summary>
        public static readonly string Vowel = @"^(a|e|i|o|u)$";

        /// <summary>
        /// [{0}] - is define the Single character set, each of those single characters will be matched agaist the first character of the  item to check.
        /// The Final patter will look like, 
        /// if itemToCheck is for example, "ababababab" and length of this item is 10 and if singles chracter set is for example abab
        /// then final pattern will look like, [abab]......... in here . is 9 times because total length of itemToCheck is 10 and we have to minus 1 as 
        /// single character set will count as 1.
        /// </summary>
        public static readonly string FirstLetterIsInAlphabetSet = @"[{0}]";

        /// <summary>
        /// [{0}] - is define the Single character set, each of those single characters will be matched agaist the first character of the  item to check.
        /// The Final patter will look like, 
        /// if itemToCheck is for example, "ababababab" and length of this item is 10 and if singles chracter set is for example abab
        /// then final pattern will look like, [abab]......... in here . is 9 times because total length of itemToCheck is 10 and we have to minus 1 as 
        /// single character set will count as 1.
        /// </summary>
        public static readonly string FirstLetterIsNotInAlphabetSet = @"[^{0}]";
    }
}
